home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The PC-SIG Library 9
/
The PC-SIG Library on CD ROM - Ninth Edition.iso
/
101_200
/
DISK0163
/
DISK0163.ZIP
/
ESCT.C
< prev
next >
Wrap
Text File
|
1983-08-22
|
512b
|
22 lines
/* version.c by Michael Hanson */
/* you may use this, but not for profit, and give me credit */
/* esc - map string into escaped character if appropriate */
char esc(s,i)
register char s[];
int *i;
{
int index();
static char real[] = " \\\b\t\v\f\n\r\(\!\)\^";
static char symb[] = "s\\btvfnr(!)^";
if(s[*i] != '\\')
return s[*i];
if(s[*i] == '\0') /* not special at end */
return '\\';
(*i)++;
real[sizeof(real)-1] = s[*i];
return real[index(symb, s[*i])];
}